package day02;

public class DataTypeDemo {
    public static void main(String[] args) {
        byte b1 = 5;
        byte b2 = 6;
        byte b3 = (byte) (b1+b2);



        System.out.println(2+2);//4
        System.out.println(2+'2');//52,2加上'2'的码50
        System.out.println('2'+'2');//100,'2'的码50，加上'2'的码50
        System.out.println('2');//2

        int a = '我';//看字符对应的码
        System.out.println(a);
        char b = 65;//看码对应的字符
        System.out.println(b);



















        /*
        int a = 5;
        long b = a;
        int c = (int)b;
        long d = 5;
        double e = 5;
        System.out.println(e);//5.0
        long f = 10000000000L;
        int g = (int)f;
        System.out.println(g);//强转有可能发生溢出
        double h = 25.678;
        int i = (int)h;
        System.out.println(i);//强转可能丢失精度

         */





















        /*
        char c1 = '阿';//'a'=97  'A'=65   '0'48
        System.out.println(c1);
        char c2 = 'd';
        //char c3 = 'wo';
        //char c4 = '我的';
        char c5 = 48;
        System.out.println(c5);
        char c6 = 'A';
        char c7 = 65;//0到65535之间
        System.out.println(c7);
        char cq = 32541;//0到65535之间
        System.out.println(cq);
        char c8 = '\'';
        System.out.println(c8);
        char c9 = '\\';
        System.out.println(c9);

         */




















        /*
        boolean a = true;
        boolean b = false;

         */
















        /*
        double a = 25.678;
        float b = 25.678F;
        double c = 3.0,d = 2.9;
        System.out.println(c-d); //0.10000000000000009.发生舍入误差
        double j = 15.0,e = 9.9;
        System.out.println(j-e);

         */















        /*
        long a = 25L;
        long c = 10000000000L;
        long d = 365L*24*60*60*1000;
        System.out.println(d);
        long e = 1000000000*2*10L;
        System.out.println(e);
        long f = 1000000000L*3*10;
        System.out.println(f);

         */




















        /*
        int a = 250;
        System.out.println(5/2);
        System.out.println(2/5);
        System.out.println(5/2.0);
        int d = 21474836447;
        d = d+1;
        System.out.println(d);
        */
    }
}
